These functions can be used to facilitate interpreting centrality and clustering coefficients. The plot functions use ggplot2 (Wickham, 2009). The table functions create a long format table which can easily be plotted in ggplot2.
centralityPlot(..., labels, scale = c("raw0", "raw", "z-scores", "relative"),
include =c("Degree","Strength","OutDegree","InDegree","OutStrength",
"InStrength"), theme_bw = TRUE, print = TRUE, verbose = TRUE,
standardized, relative, weighted = TRUE,signed = TRUE,
orderBy = "default", decreasing = FALSE, communities = NULL,
useCommunities = "all")
clusteringPlot(..., scale = c("raw0", "raw", "z-scores", "relative"), labels,
include , signed = FALSE, theme_bw = TRUE, print = TRUE,
verbose = TRUE, standardized, relative,orderBy = "default",
decreasing = FALSE)
centralityTable(..., labels, standardized = TRUE, relative = FALSE, weighted =
TRUE, signed = TRUE, communities = NULL, useCommunities = "all")
clusteringTable(..., labels, standardized = TRUE, relative = FALSE,
signed = FALSE)centralityPlot and clusteringPlot return a ggplot2 plot object (invisibly if print = TRUE). centralityTable and clusteringTable return a long format data frame with the columns graph, type, node, measure and value.
Objects usable in the getWmat generic, such as qgraph objects and weights matrices. Can also be lists containing these objects. Graphs in a list will be plotted in the same panel as different lines and graphs in separate arguments will be plotted in separate panels.
Scale of the x-axis. "z-scores" to plot standardized coefficients, "raw" to plot raw coefficients, "raw0" to plot raw coefficients while including 0 on the x-axis and "relative" to show values on a relative scale from 0 (lowest) to 1 (highest).
A vector overwriting the labels used. Can be missing.
A vector of measures to include. If missing, centralityPlot includes the default set of measures shown in the usage section, while clusteringPlot includes all available measures. Not included by default in centralityPlot are "Closeness", "Betweenness", "ExpectedInfluence", "OutExpectedInfluence", and "InExpectedInfluence". Can also be "all" or "All" to include all available centrality measures. When communities is supplied, the bridge centrality measures "Bridge Strength", "Bridge Indegree" and "Bridge Outdegree" are included by default as well, and "Bridge Betweenness", "Bridge Closeness", "Bridge Expected Influence (1-step)" and "Bridge Expected Influence (2-step)" can be included by hand or via "all".
Adds the ggplot2 black and white theme to the plot.
If TRUE, the plot is sent to the print command and returned invisible, if FALSE the plot is returned normally. Needed to include plots in e.g., pdf files.
Should messages be printed to the console?
Logical, should all measures be standardized? Argument is deprecated and will be removed.
Logical, should all measures be scaled relative to the largest value? Argument is deprecated and will be removed.
Logical, set to FALSE to set all edge weights to 1 or -1
Logical, set to FALSE to make all edge weights absolute
String indicating which measure to order by. Can be "default" (nodes ordered by natural sort of their labels), or one of the measures plotted (e.g., "Strength")
Logical indicating if the nodes should be ordered increasing or decreasing
A community assignment of each node (see bridgeCentrality for supported formats). When supplied, the bridge centrality statistics of Jones, Ma and McNally (2021) are computed and included in the table/plot (only in centralityPlot and centralityTable). Defaults to NULL, in which case no bridge centrality statistics are computed.
A character vector specifying which communities should be included in the computation of bridge centrality. Defaults to "all". See bridgeCentrality.
Sacha Epskamp <mail@sachaepskamp.com> and Jolanda Kossakowski
H. Wickham. ggplot2: elegant graphics for data analysis. Springer New York, 2009.
Jones, P. J., Ma, R., & McNally, R. J. (2021). Bridge centrality: A network approach to understanding comorbidity. Multivariate Behavioral Research, 56(2), 353-367.
bridgeCentrality, centrality_auto